-- @owner: @zhanghuan96
-- @date: 2024/9/19
-- @testpoint: body作为变量名
@conn PrimaryDbDmode;
--step1:创建函数，body作为变量名;expect:成功
drop function if exists func_rowcount0023();
CREATE OR REPLACE FUNCTION func_rowcount0023()
RETURNS BIGINT
LANGUAGE plpgsql
AS $$
DECLARE
    body BIGINT;
BEGIN
    body := @@spid;
    RAISE NOTICE 'NOTICE:当前会话进程ID: %', body;
    RETURN body;
END;
$$;
/
--step2:调用函数;expect:成功
call func_rowcount0023();
--step3:清理环境;expect:成功
drop function if exists func_rowcount0023();